package com.atguigu.tingshu.album.config;

import io.minio.MinioClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author ajin
 * @create 2024-09-29 20:29
 */
@Configuration
public class MinioConfig {

    /**
     * 注册操作MInIO客户端对象
     * @return
     */
    @Bean
    public MinioClient minioClient(MinioConstantProperties minioConstantProperties){
        return MinioClient.builder()
                .endpoint(minioConstantProperties.getEndpointUrl()) //操作Minio地址 端口9000
                .credentials(minioConstantProperties.getAccessKey(),minioConstantProperties.getSecreKey())
                .build();
    }
}
